package bongo.framework.gameobject.component;

import bongo.framework.gameobject.GameObject;

/**
 * Provides default functionality for the {@link Component} interface
 * <br/>Usage example:
 * <pre>
 * public class SomeComponent extends AbstractComponent{
 * 		private SomeOtherComponent c;
 * 
 * 		public void init(){
 * 			//get a reference the other component here
 * 			c = this.gameObject().getComponent(SomeOtherComponent.class);
 * 		}
 * 		.
 * 		.
 * 		.
 * 		//other stuff specific to this component
 * }
 * 
 * </pre>
 * @author boogie
 *
 */
public abstract class AbstractComponent implements Component{
	private static final long serialVersionUID = 1L;
	
	private GameObject gameObject;

	/* (non-Javadoc)
	 * @see my.game.core.gameobject.Component#setGameObject(my.game.core.gameobject.GameObject)
	 */
	@Override
	public final void setGameObject(GameObject g) {
		this.gameObject = g;
	}

	/* (non-Javadoc)
	 * @see my.game.core.gameobject.Component#gameObject()
	 */
	@Override
	public final GameObject gameObject() {
		return this.gameObject;
	}
	

	/* (non-Javadoc)
	 * @see my.game.core.gameobject.Component#init()
	 */
	@Override
	public void init() {
		
	}
	/* (non-Javadoc)
	 * @see my.game.core.gameobject.Component#destroy()
	 */
	@Override
	public void destroy() {
		
	}
	
	/* (non-Javadoc)
	 * @see my.game.core.gameobject.Component#update(float)
	 */
	@Override
	public void update(float delta) {
		
	}
	
	/* (non-Javadoc)
	 * @see my.game.core.gameobject.Component#paint(float)
	 */
	@Override
	public void paint(float delta) {
			
	}
}
